import { ParameterizedContext } from 'koa'
import registerService from '../service/register.service'

type Tbody = {
  nickname: string
  username: string
  password: string
  uuid: string
  captcha: string
}

class RegisterController {
  async register(ctx: ParameterizedContext) {
    const { nickname, username, password, uuid, captcha } = ctx.request.body as Tbody
    ctx.body = await registerService.register(nickname, username, password, uuid, captcha)
  }
}

export default new RegisterController()
